/**
 * 读取静态文件内容
 */
export default async (path= '') => {

  if (!path) { return false; }

  return new Promise(function(resolve) {
    const xhr = new XMLHttpRequest();
    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4 && xhr.status === 200) {
        resolve(xhr.responseText); }
    };
    xhr.onerror = (e) => {
      resolve(e);
    };
    
    xhr.open('get', path, true);

    xhr.send(null);

  });

};
